<?php
/**
 * Created by PhpStorm.
 * User: beijingwhg
 * Date: 2017/5/11
 * Time: 下午1:03
 */

namespace App\Http\Controllers\Admin;


use App\Http\Controllers\Controller;

class IndexController extends Controller
{
    public function index()
    {
        $powers = getPowersArray();

        $myPower = getMyPower();

        $first = '';

        foreach ($powers as $pid=>$power) {
            if (key_exists($pid, $myPower)) {
                $first = $power->power_key;

                break;
            }
        }

        return redirect('/admin/'.$first);
    }
}